function Plugins() {
  this.loadingInstance;

  const normal = (type, message, cb) => {
    ELEMENT.Message({
      message,
      type,
      duration: 1200,
      offset: 120,
      onClose: () => {
        cb ? cb() : null;
      },
    });
  };

  this.msg = function (message) {
    normal("info", message);
  };
  // 错误消息
  this.msgError = function (message) {
    normal("error", message);
  };
  // 成功消息
  this.msgSuccess = function (message, cb) {
    normal("success", message, cb);
  };
  // 警告消息
  this.msgWarning = function (message) {
    normal("warning", message);
  };
  // 弹出提示
  this.alert = function (content) {
    ELEMENT.MessageBox.alert(content, "系统提示");
  };
  // 错误提示
  this.alertError = function (content) {
    ELEMENT.MessageBox.alert(content, "系统提示", { type: "error" });
  };
  // 成功提示
  this.alertSuccess = function (content) {
    ELEMENT.MessageBox.alert(content, "系统提示", { type: "success" });
  };
  // 警告提示
  this.alertWarning = function (content) {
    ELEMENT.MessageBox.alert(content, "系统提示", { type: "warning" });
  };
  // 通知提示
  this.notify = function (content) {
    ELEMENT.Notification.info(content);
  };
  // 错误通知
  this.notifyError = function (content) {
    ELEMENT.Notification.error(content);
  };
  // 成功通知
  this.notifySuccess = function (content) {
    ELEMENT.Notification.success({ title: content, duration: 800 });
  };
  // 警告通知
  this.notifyWarning = function (content) {
    ELEMENT.Notification.warning(content);
  };
  // 确认窗体
  this.confirm = function (content, call) {
    return ELEMENT.MessageBox.confirm(content, "系统提示", {
      confirmButtonText: "确定",
      cancelButtonText: "取消",
      type: "warning",
    }).then((_) => {
      call ? call() : null;
    });
  };
  // 提交内容
  this.prompt = function (content) {
    return ELEMENT.MessageBox.prompt(content, "系统提示", {
      confirmButtonText: "确定",
      cancelButtonText: "取消",
      type: "warning",
    });
  };
  // 打开遮罩层
  this.loading = function (content) {
    this.loadingInstance = ELEMENT.Loading.service({
      lock: true,
      text: content,
      spinner: "el-icon-loading",
      background: "rgba(0, 0, 0, 0.7)",
    });
  };
  // 关闭遮罩层
  this.closeLoading = function () {
    this.loadingInstance.close();
  };
}
